
# 博客首页测试用例
from selenium.webdriver.common.by import By

from common.Utils import BlogDriver


class BlogList:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "file:///D:/gitee%E8%BF%9C%E7%A8%8B%E5%85%B3%E8%81%94%E5%BA%93/front-end/Blog_system/BlogPage/html/blog_list.html"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)
    # 测试首页（登录情况下）
    def ListTestByLogin(self):
        # 测试博客标题是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div:nth-child(1) > div.title")
        # 测试博客内容是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div:nth-child(1) > div.desc")
        # 测试查看按钮是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div:nth-child(1) > a")

        # 测试登录正常昵称是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-left > div > h3")
        # 添加屏幕截图
        BlogDriver.getScreeShot()

    # 测试首页（未登录情况下）



